package com.black.play.entity;


import java.awt.*;

/**
 * 格子类型枚举类
 *
 * @author ylx
 */
public enum CellValue
{
    EMPTY("", Color.BLUE),
    NUMBER_1("1", Color.RED),
    NUMBER_2("2", Color.ORANGE),
    NUMBER_3("3", Color.YELLOW),
    NUMBER_4("4", Color.GREEN),
    NUMBER_5("5", Color.CYAN),
    NUMBER_6("6", Color.BLUE),
    NUMBER_7("7", new Color(193, 2, 250)),
    NUMBER_8("8", new Color(244, 2, 83)),
    NUMBER_9("9", Color.BLACK),
    ;
    final String text;
    final Color fontColor;

    CellValue(String text, Color fontColor)
    {
        this.text = text;
        this.fontColor = fontColor;
    }

    public String getText()
    {
        return text;
    }

    public Color getFontColor()
    {
        return fontColor;
    }

    public static int indexOf(CellValue value)
    {
        CellValue[] values = values();
        for (int i = 0; i < values.length; i++)
        {
            if (values[i] == value)
            {
                return i;
            }
        }
        return -1;
    }
}
